package androidx.core.app;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import androidx.annotation.CallSuper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.d;
import o.dy;
import o.hh;
import o.hh.c;
import o.kp;
import o.kv;
import o.kx;
import o.ky;

@RestrictTo({d.ॱ})
public class ComponentActivity extends Activity implements kv, c {
    private kx ˎ = new kx(this);
    private dy<Class<? extends Object>, Object> ॱ = new dy();

    @SuppressLint({"RestrictedApi"})
    protected void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        ky.ˋ(this);
    }

    @CallSuper
    protected void onSaveInstanceState(@NonNull Bundle bundle) {
        this.ˎ.ˋ(kp.c.CREATED);
        super.onSaveInstanceState(bundle);
    }

    @NonNull
    public kp ac_() {
        return this.ˎ;
    }

    @RestrictTo({d.ॱ})
    public boolean ˊ(KeyEvent keyEvent) {
        return super.dispatchKeyEvent(keyEvent);
    }

    public boolean dispatchKeyShortcutEvent(KeyEvent keyEvent) {
        View decorView = getWindow().getDecorView();
        if (decorView == null || !hh.ˊ(decorView, keyEvent)) {
            return super.dispatchKeyShortcutEvent(keyEvent);
        }
        return true;
    }

    public boolean dispatchKeyEvent(KeyEvent keyEvent) {
        View decorView = getWindow().getDecorView();
        if (decorView == null || !hh.ˊ(decorView, keyEvent)) {
            return hh.ˋ(this, decorView, this, keyEvent);
        }
        return true;
    }
}
